# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=ruby-semantic
_gemname=${pkgname#ruby-}
pkgver=1.6.1
pkgrel=0
pkgdesc="Semantic Version utility class for parsing, storing, and comparing versions"
url="https://rubygems.org/gems/semantic"
arch="noarch"
license="MIT"
checkdepends="ruby-rake ruby-rspec ruby-bundler"
depends="ruby"
source="$pkgname-$pkgver.tar.gz::https://github.com/jlindsey/semantic/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/$_gemname-$pkgver"

prepare() {
	default_prepare

	sed -i '/spec.signing_key/d' $_gemname.gemspec
}

build() {
	gem build $_gemname.gemspec
}

check() {
	rake
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"
	local geminstdir="$gemdir/gems/$_gemname-$pkgver"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc \
		"$geminstdir"/*.md
}
sha512sums="
27e65f2d0f54529d8ba3b7a09171747cb7029b3420714ae5be904bb175b333a09e557d5cac7607a1b2b7888f9de1684299ebd44c5c852b19058d53e7c60d303c  ruby-semantic-1.6.1.tar.gz
"
